package com.jsmile.cloud.tradecenter.api.feign;

import javax.validation.Valid;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.jsmile.cloud.tradecenter.api.constants.TradeConstants;
import com.jsmile.cloud.tradecenter.api.req.cart.ReqAddCart;
import com.jsmile.cloud.tradecenter.api.req.cart.ReqCartDetial;
import com.jsmile.cloud.tradecenter.api.req.cart.ReqDeleteCart;
import com.jsmile.cloud.tradecenter.api.req.cart.ReqUpdateCart;
import com.jsmile.mall.api.JSmileResult;

@FeignClient(value = TradeConstants.APPLICATION_NAME, contextId = "cart")
public interface CartServiceApi {

    @RequestMapping(value = "/feign/cart/addCart", method = RequestMethod.POST)
    JSmileResult addCart(ReqAddCart reqAddCart);

    @RequestMapping(value = "/feign/cart/cartDetial", method = RequestMethod.POST)
    JSmileResult cartDetial(@RequestBody @Valid ReqCartDetial reqCartDetial);

    @RequestMapping(value = "/feign/cart/updateCart", method = RequestMethod.POST)
    JSmileResult updateCart(@RequestBody @Valid ReqUpdateCart reqUpdateCart);

    @RequestMapping(value = "/feign/cart/deleteCart", method = RequestMethod.POST)
    JSmileResult deleteCart(@RequestBody @Valid ReqDeleteCart reqDeleteCart);

    @RequestMapping(value = "/feign/cart/clearCart", method = RequestMethod.POST)
    JSmileResult clearCart(@RequestBody @Valid ReqCartDetial reqCartDetial);

    @RequestMapping(value = "/feign/cart/countCart", method = RequestMethod.POST)
    JSmileResult countCart(@RequestBody @Valid ReqCartDetial reqCartDetial);
}
